/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.javalearningproject.VEK_ME;

import com.googlecode.javalearningproject.util.FileGetter;
import java.io.IOException;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;

/**
 *
 * @author Administrator
 */
public class BackgroundMap extends Canvas implements CommandListener{
    
    private Image background;
    private Command cmExit;
    private Main midlet;
    
    public BackgroundMap(Main mid) throws IOException
    {
        midlet = mid;
        background = FileGetter.getImage("kort.gif");
        
        cmExit = new Command("Exit", Command.EXIT, 1);
        addCommand(cmExit);
        setCommandListener(this);
    }

    protected void paint(Graphics g) {
        g.drawImage(background, 0, 0, 0);
    }
    
    public void commandAction(Command c, Displayable d)
  {
    if (c == cmExit)
    {
      midlet.exitMIDlet();
    }
  }
    
    

}
